package com.jerome.election.http;

/**
 * HttpMethod enumeration
 * @author jerome
 * @date 2023/7/28
 */
public enum HttpMethodEnum {
    GET("GET"),
    PUT("PUT"),
    POST("POST"),
    DELETE("DELETE"),
    /****Customized****/
    //PAXOS Services
    PAXOS("PAXOS"),
    ;

    public static HttpMethodEnum getByCode(String code){
        for (HttpMethodEnum value : HttpMethodEnum.values()) {
            if (code.equals(value.code)){
                return value;
            }
        }
        return GET;
    }

    private String code;

    HttpMethodEnum(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
    
}
